package ch14;

import java.io.DataOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;

class _08_DataOutputStreamEx {
	public static void main(String args[]) {
		FileOutputStream fos = null;
		DataOutputStream dos = null;

		try {
			fos = new FileOutputStream("c:/sample.dat");
			dos = new DataOutputStream(fos);
			dos.writeInt(10);
			dos.writeFloat(20.0f);
			dos.writeBoolean(true);

			dos.close();
			System.out.println("saved.");
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}